<!DOCTYPE html>
<html lang="en">

    <head>
        <title>Nursing Healthcare Information System</title><meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link rel="stylesheet" href="css/bootstrap.min.css" />
        <link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
        <link rel="stylesheet" href="css/fullcalendar.css" />
        <link rel="stylesheet" href="css/maruti-style.css" />
        <link rel="stylesheet" href="css/maruti-media.css" class="skin-color" />	
    </head>
    <body>



        <!--Header-part-->
        <div id="header">
            <h1>NHIS</h1>
        </div>

        <!--top-Header-messaages-->
        <div class="btn-group rightzero"> <a class="top_message tip-left" title="Manage Files"><i class="icon-file"></i></a> <a class="top_message tip-bottom" title="Manage Users"><i class="icon-user"></i></a> <a class="top_message tip-bottom" title="Manage Comments"><i class="icon-comment"></i><span class="label label-important">5</span></a> <a class="top_message tip-bottom" title="Manage Orders"><i class="icon-shopping-cart"></i></a> </div>
        <!--close-top-Header-messaages--> 


        <div id="sidebar">
            <a href="#" class="visible-phone"><i class="icon icon-file"></i> Menu</a>
            <ul>
                <li class="active"><a href="indexDoctor.php"><i class="icon icon-home"></i> <span>Anasayfa</span></a></li>
                <li><a href="prepareSchedule.php"><i class="icon icon-list"></i> <span>Tedavi Planı Hazırla</span></a></li>
                <li> <a href="charts.html"><i class="icon icon-th"></i> <span>Hasta Bilgisi</span></a> </li>
                <li class="submenu"> <a href="#"><i class="icon icon-signal"></i> <span>Hemşire Performansları</span></a> </li>
                <li class=""><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">Ayarlar</span></a></li>
                <li class=""><a title="" href="login.php"><i class="icon icon-share-alt"></i> <span class="text">Çıkış</span></a></li>
            </ul>

        </div>


        <div id="content">
            <div id="content-header">
                <div id="breadcrumb"><a href="#" title="Anasayfaya Git" class="tip-bottom"><i class="icon-home"></i> Anasayfa</a><a href="#" class="current">Tedavi Planı Hazırla</a></div>
                <h1>Tedavi Planı Hazırla</h1>
                <form name="treatmentForm">                               
                    <table class="table table-bordered table-striped" >
                        <tr>
                            <td>
                                <select name="hastalar" onchange="getPatientDetailed()">
                                    <option selected disabled>Hasta Seçiniz</option>
                                    <option value="Ömer Demir">Ömer Demir</option>
                                    <option value="Soner Tabanca">Soner Tabanca</option>
                                    <option value="Arda Tanyeri">Arda Tanyeri</option>
                                    <option value="Emir Erdogan">Emir Erdogan</option>
                                    <option value="Murat Atmaca">Murat Atmaca</option>
                                </select><br>
                            </td>
                            <td rowspan="5">
                                <textarea  name="detailedPatient" id="detailedId" cols="30" rows="14"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <select name="tedaviler">
                                    <option selected disabled>Tedavi Seçiniz</option>
                                    <option value="Tedavi 1">Tedavi 1</option>
                                    <option value="Tedavi 2">Tedavi 2</option>
                                    <option value="Tedavi 3">Tedavi 3</option>
                                    <option value="Tedavi 4">Tedavi 4</option>             
                                </select> 
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <select name="saat">
                                    <option selected disabled>Saat</option>
                                    <?php
                                    for ($i = 1; $i < 25; $i++) {
                                        echo "<option value='$i'>$i</option>";
                                    }
                                    ?>                                      
                                </select><br>
                                <select name="dakika">
                                    <option selected disabled>Dakika</option>
                                    <?php
                                    for ($i = 0; $i < 60; $i++) {
                                        echo "<option value='$i'>$i</option>";
                                    }
                                    ?>                                      
                                </select><br>
                                <input type="text" name="gün" placeholder="Uygulanacağı Gün Sayısı" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <input type="button" class="btn btn-success" onclick="addTreatment()" value="Tedavi Ekle" />
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td>
                                <h4>Tedaviler</h4>
                                <textarea  align="center" name="patientTreatments" id="detailedId" cols="30" rows="10"></textarea>
                                <br> <input type="button" class="btn btn-success" onclick="createPlan()" value="Planı Onulştur" />
                            </td>
                            <td>
                                <div id="planArea"></div>
                            </td>
                        </tr>
                    </table>
                </form>          
            </div>
        </div><div class="row-fluid">
            <div id="footer" class="span12">2014 &copy; NHIS</div>
        </div>
        <script src="js/jquery.min.js"></script>
        <script src="js/jquery.ui.custom.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/fullcalendar.min.js"></script>
        <script src="js/maruti.js"></script>
        <script src="js/maruti.calendar.js"></script>
        <script type="text/javascript">
            // This function is called from the pop-up menus to transfer to
            // a different page. Ignore if the value returned is a null string:
            function goPage (newURL) {

                // if url is empty, skip the menu dividers and reset the menu selection to default
                if (newURL != "") {
      
                    // if url is "-", it is this page -- reset the menu:
                    if (newURL == "-" ) {
                        resetMenu();            
                    } 
                    // else, send page to designated URL            
                    else {  
                        document.location.href = newURL;
                    }
                }
            }

            // resets the menu selection upon entry to this page:
            function resetMenu() {
                document.gomenu.selector.selectedIndex = 2;
            }
            
            function getPatientDetailed()
            {        
                treatmentForm.detailedPatient.value="Hastanın Detaylı Bilgisi..";
            }
            
            
            function addTreatment()
            {   
                if(treatmentForm.tedaviler.value != "Tedavi Seçiniz")
                {
                    treatmentForm.patientTreatments.value += treatmentForm.tedaviler.value+"\n";              
                }
               
            }
            
            function createPlan()
            {   
                
               var myArea = document.getElementById("planArea");
               var günSayisi = treatmentForm.gün.value;
              
               var str="<h4>"+treatmentForm.hastalar.value+" Tedavi Planı</h4><table border='1px'><tr>";
               
               for(i=1;i<=günSayisi;i++)
                   {
                       
                       str+="<td>"+i+". gün</td>"; 
                   }             
                   str+="</tr>";
                   str+="<tr>";
               for(i=1;i<=günSayisi;i++)
                   {
                      str+="<td>";
                     str+=treatmentForm.patientTreatments.value;
                     str+="</td>";
                   }
                str+="<tr></table>";
               myArea.innerHTML =str;
            }
            
        </script>
    </body>

</html>
